package com.zhang.authoritycenter.common.model.dao.authority;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * <p>
 * 系统菜单表
 * </p>
 *
 * @author KingHood
 * @since 2023-12-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("authority_menu")
public class AuthorityMenuDO extends Model<AuthorityMenuDO> {

    private static final long serialVersionUID = 1L;

    @TableId("id")
    private Long id;

    /**
     * 归属类型（0：组织中心，1，商品中心）
     */
    @TableField("belong_type")
    private Integer belongType;

    /**
     * 父ID
     */
    @TableField(value = "parent_id",updateStrategy = FieldStrategy.ALWAYS)
    private Long parentId;

    /**
     * id路径
     */
    @TableField(value = "id_path",updateStrategy = FieldStrategy.ALWAYS)
    private String idPath;

    /**
     * 从1级开始
     */
    @TableField(value = "level",updateStrategy = FieldStrategy.ALWAYS)
    private Integer level;

    /**
     * 显示图标
     */
    @TableField(value = "icon",updateStrategy = FieldStrategy.ALWAYS)
    private String icon;

    /**
     * 资源类型：1目录；2功能菜单；3按钮；4:字段
     */
    @TableField("resource_type")
    private Integer resourceType;

    /**
     * 权限编码
     */
    @TableField(value = "permission_code",updateStrategy = FieldStrategy.ALWAYS)
    private String permissionCode;

    /**
     * 资源名称
     */
    @TableField(value = "name",updateStrategy = FieldStrategy.ALWAYS)
    private String name;
    /**
     * 路由
     */
    @TableField(value = "path",updateStrategy = FieldStrategy.ALWAYS)
    private String path;
    /**
     * 排序
     */
    @TableField(value = "sort",updateStrategy = FieldStrategy.ALWAYS)
    private Integer sort;

    /**
     * 状态：0禁用；1启用；
     */
    @TableField("status")
    private Integer status;

    /**
     * 0：不显示，1：显示
     */
    @TableField("is_show")
    private Integer isShow;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("update_time")
    private Date updateTime;

    /**
     * 创建人人id
     */
    @TableField("create_user_id")
    private Long createUserId;

    /**
     * 最后修改人id
     */
    @TableField("update_user_id")
    private Long updateUserId;

    /**
     * 是否删除：0未删除；1已删除
     */
    @TableField("is_delete")
    private Integer isDelete;


    @TableField(exist = false)
    private String createUserName;

    @TableField(exist = false)
    private String updateUserName;


}
